﻿/**
* 命名空间: ICS_Equipment.Components
*
* 功 能：管道
* 类 名： Pipeline
*
* Ver 变更日期 负责人 变更内容
* ───────────────────────────────────
* V0.01 2021/9/17 15:34:21 小柚子爱学习 初版
*
* Copyright (c) 2021 Lir Corporation. All rights reserved.
*┌──────────────────────────────────┐
*│　此技术信息为个人机密信息，未经本人书面同意禁止向第三方披露．　│
*│　版权所有：Vip_Future 　　　　　　　　　　　　　　│
*└──────────────────────────────────┘
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ICS_Equipment.Components
{
    /// <summary>
    /// Pipeline.xaml 的交互逻辑
    /// </summary>
    public partial class Pipeline : UserControl
    {


        public int Direction
        {
            get { return (int)GetValue(DirectionProperty); }
            set { SetValue(DirectionProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Direction.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty DirectionProperty =
            DependencyProperty.Register("Direction", typeof(int), typeof(Pipeline), new PropertyMetadata(default(int),new PropertyChangedCallback(OnDirectionChanged)));

        public static void OnDirectionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {

            int value = int.Parse( e.NewValue.ToString());

            VisualStateManager.GoToState(d as Pipeline, value == 1 ? "WEFlowState" : "EWFlowState", false);
        }


        public Brush liguidColor
        {
            get { return (Brush)GetValue(liguidColorProperty); }
            set { SetValue(liguidColorProperty, value); }
        }

        // Using a DependencyProperty as the backing store for liguidColor.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty liguidColorProperty =
            DependencyProperty.Register("liguidColor", typeof(Brush), typeof(Pipeline), new PropertyMetadata(Brushes.Orange));


        public int CapRadius
        {
            get { return (int)GetValue(CapRadiusProperty); }
            set { SetValue(CapRadiusProperty, value); }
        }

        // Using a DependencyProperty as the backing store for CapRadius.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty CapRadiusProperty =
            DependencyProperty.Register("CapRadius", typeof(int), typeof(Pipeline), new PropertyMetadata(0));



        public Pipeline()
        {
            InitializeComponent();
        }
    }
}
